<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<nav class="navbar navbar-default">
    <div class="container-fluid">
        <div class="navbar-header">
            <a class="navbar-brand">
                <span>资讯</span>
            </a>
        </div>
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <c:if test="${sessionUser!=null}">
                    <li><a href="#">${sessionUser.username}</a></li>
                </c:if>
                <c:if test="${sessionUser==null}">
                    <li><a href="/login.do">登录</a></li>

                    <li><a href="/register.do">注册</a></li>
                </c:if>

            </ul>
            <ul class="nav navbar-nav navbar-right">
                <li><a href="/admin/index.do">管理员后台</a></li>
                <c:if test="${sessionUser!=null}">
                    <li><a href="/news/send.do">发表资讯</a></li>
                    <li><a href="/logout.do">退出</a></li>
                </c:if>
            </ul>
        </div>
    </div>
</nav>
